package com.grocery.controller;

import com.grocery.util.LayData;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class ShoppingExceptionHandler {

    @ExceptionHandler()
    @ResponseBody
    public LayData handlerException(Exception e){
        e.printStackTrace();
        return LayData.error(e);
    }
}
